<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Center extends CI_Controller {

	function __construct(){
			parent::__construct();
			$this->load->model("Center_model");
			$this->load->model("tour_ks/Tour_model");
	}
	public function index()
	{
		
		$this->load->helper('form');
		$data["item"]= $this->Center_model->menu();
	
		$data1["item"]= $this->Center_model->danhmuctour();
		$data['item1']=$this->Center_model->load_diemkhoihanh();
		$data2["item"]= $this->Center_model->danhmuctour();
		for($i=0;$i<count($data2["item"]);$i++)
		{
			$data2["item"][$i]['tour']=$this->Center_model->tour($data2["item"][$i]['id_danhmuc']);
		}
		$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('outline/content_right',$data2);
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	  		
	}
	public function timkiem()
	{
		$this->load->helper('form');
		$data["item"]= $this->Center_model->menu();
		$data1["item"]= $this->Center_model->danhmuctour();
		$data['item1']=$this->Center_model->load_diemkhoihanh();
		
		$giatri['sltdiemkhoihanh'] = $_POST['sltdiemkhoihanh'];
		$giatri['slttour'] = $_POST['slttour'];
		
		$datavidu['dulieu'] = $this->Center_model->timkiem($giatri);
		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('timkiem',$datavidu);
		$data3["tt_nb"] = $this->Center_model->tt_moinhat();
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	function testselect()
		{
			$data['item']=$this->Center_model->load_diemkhoihanh();
			$this->load->view("admin/testselect", $data);
		}
    function selectdcchon()
		{
			$str="";
			$diemkhoihanh1 = $_GET['start_express'];
			$select = "";
			$tentour= $this->Center_model->load_tour($diemkhoihanh1);
			foreach($tentour as $key => $value)
			{
				$select .= "<option value='".$value['ten_tour']."'>".$value['ten_tour']."</option>";
				
			}
			echo $select;
			
		}
	
	/////timkiem----
	
	
	
	
	public function thongtinvn()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();
	
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('thongtinvn');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function dbscuulong()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('dbscuulong');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function gtdongthap()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('gtdongthap');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function quangcao1()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('outline/quangcao1');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function quangcao2()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('outline/quangcao2');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function quangcao3()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('outline/quangcao3');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	public function quangcao4()
	{	
	$data["item"]= $this->Center_model->menu();
	$data1["item"]= $this->Center_model->danhmuctour();
	$data3["tt_nb"] = $this->Center_model->tt_moinhat();

		
		$this->load->view('outline/dangnhap');
		$this->load->view('outline/header',$data);
		$this->load->view('outline/giohang');
		$this->load->view('outline/content_left',$data1);
		$this->load->view('outline/clip');
		$this->load->view('outline/quangcao4');
		$this->load->view('outline/tintuc',$data3);
		$this->load->view('outline/footer',$data);
	}
	
	//PHÂN THÔNG BÁO TIN TỨC
	
	public function tintuc($currentPage=0){
			$data2["number"] = $this->Center_model->count_tt();
			//paging
			
			$this->load->library('pagination');
			$config['base_url'] = base_url()."index.php/center/tintuc";
			$config['total_rows'] = $this->Center_model->count_tt();
			$config['per_page'] = 2;
			$config['num_links'] = 2;
			//$config['use_page_numbers'] = TRUE;
			$this->pagination->initialize($config);
			$data2["paging"] = $this->pagination->create_links(); 
			$data2["lists"] = $this->Center_model->getall1($currentPage, $config['per_page']);
			//print_r($data2);
			$this->load->view('outline/dangnhap');
			$data["item"]= $this->Tour_model->menu();
			$this->load->view("outline/header",$data);
			$this->load->view('outline/giohang');
			$data1["item"]= $this->Center_model->danhmuctour();
			$this->load->view('outline/content_left',$data1);
			$this->load->view('outline/clip');
			//$this->load->view('outline/quangcao4');
			$this->load->view("tour_ks/tintuc",$data2);
			$this->load->view('outline/footer',$data);
		}
		
		public function detail1($id){
			$data2["item"] = $this->Center_model->getbyid1($id);
			//$data2['image']=$this->Center_model->get_image();
			$this->load->view('outline/dangnhap');
			$data["item"]= $this->Tour_model->menu();
			$this->load->view("outline/header", $data);
			$this->load->view('outline/giohang');
			$data1["item"]= $this->Center_model->danhmuctour();
			$this->load->view('outline/content_left',$data1);
			$this->load->view('outline/clip');
			//$this->load->view('outline/quangcao4');
			//$this->load->view("center_view",$data2);
			$this->load->view("tour_ks/detail", $data2);
			$this->load->view('outline/footer',$data);
		}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */